<?php
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Wap Content',
    'language'=>'vi',
	
	'preload'=>array('log'),
	
	'import'=>array(
		'application.models.*',        
        'application.components.*',
        'application.extensions.*', 
        'application.extensions.url.*',                 
        'application.utilities.*', 
        'zii.widgets.CPortlet',
	),

	'defaultController'=>'home',
    
	'modules' => array(
      'admincp',
    ),
	'components'=>array(
		'user'=>array(			
			'allowAutoLogin'=>true,
		),
                  
        'CURL' =>array(
            'class' => 'application.extensions.curl.Curl'
        ),
        
        'db'=>array(
            'connectionString' => 'mysql:host=localhost;dbname=hdc_wap_content',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
            'class'=>'CDbConnection'            
        ),
        
		'errorHandler'=>array(			
            'errorAction'=>'home/error',
        ),
        'urlManager'=>array(
            'urlFormat'=>'path',
            'showScriptName'=>false,            
            'caseSensitive' => true,
            'rules'=>array(                                
                '/<page:\d+>'=>'home/index',
                '/'=>'home/index',
                '/<alias>-t-<id:\d+>'=>'home/tipDetail',
                '/<alias>-e-<id:\d+>'=>'home/eventDetail',
                '/phan-hoi'=>'home/feedback',
                
                /* -- Service-- */
                '/dich-vu'=>'service/index',
                '/danh-sach-game-online-<t:\d+>'=>'service/gameOnlineList',
                '/danh-sach-game-online-<t:\d+>/<page:\d+>'=>'service/gameOnlineList',
                '/danh-sach-game-offline-<t:\d+>'=>'service/gameOfflineList',
                '/danh-sach-game-offline-<t:\d+>/<page:\d+>'=>'service/gameOfflineList',
                '/danh-sach-app-<t:\d+>'=>'service/appList',
                '/danh-sach-app-<t:\d+>/<page:\d+>'=>'service/appList',
                '/t-<type\d+>-<alias>-<id:\d+>'=>'service/applicationDetail',
                '/t-<type\d+>-<alias>-<id:\d+>/<page:\d+>'=>'service/applicationDetail',
                '/review-<type\d+>-<alias>-<id:\d+>'=>'service/review',
                '/gan-thanh-toan-jar'=>'service/attachPaymentJarOption', 
                '/gan-thanh-toan-jar/upfile'=>'service/uploadFileJar', 
                '/danh-sach-file-gan-kh-jar'=>'service/gameModListJar', 
                '/danh-sach-file-gan-kh-jar/<page:\d+>'=>'service/gameModListJar', 
                '/gan-thanh-toan-file-<id:\d+>'=>'service/gameModDetailJar',
                '/gan-thanh-toan-apk'=>'service/attachPaymentApkOption', 
                '/gan-thanh-toan-apk/upfile'=>'service/uploadFileApk', 
                '/danh-sach-file-gan-kh-apk'=>'service/gameModListApk', 
                '/danh-sach-file-gan-kh-apk/<page:\d+>'=>'service/gameModListApk', 
                '/gan-thanh-toan-file-<id:\d+>'=>'service/gameModDetailApk', 
                 /* -- End Service-- */
                
                /* -- Tool-- */
                '/cong-cu'=>'tool/index',
                '/cong-cu/rut-gon-link'=>'shortLink/index',
                '/cong-cu/park-domain'=>'tool/parkDomain',
                '/cong-cu/tao-ma-nhung-b1-<type_cat:\d+>-<type_data:\d+>'=>'tool/embedStep1',
                '/cong-cu/tao-ma-nhung-b1-<type_cat:\d+>'=>'tool/embedStep1',
                '/cong-cu/tao-ma-nhung-b1'=>'tool/embedStep1',
                '/cong-cu/tao-ma-nhung-b2'=>'tool/embedStep2',
                '/cong-cu/tao-ma-nhung-b3'=>'tool/embedStep3',
                '/cong-cu/lay-ma-nhung'=>'tool/actionEmbedDetail',
                '/cong-cu/ma-nhung-ban-tao'=>'tool/embedByUser',
                '/cong-cu/ma-nhung-ban-tao/<page:\d+>'=>'tool/embedByUser',
                '/cong-cu/lay-ma-nhung-dung-san-<embed_id:\d+>'=>'tool/embedDetailByAdmin',
                '/cong-cu/lay-ma-nhung-<embed_id:\d+>'=>'tool/embedDetail',
                /* -- End Tool-- */
                
                /* -- revenue-- */
                '/doanh-thu' => 'revenue/index',
                '/doanh-thu/hom-qua' => 'revenue/yesterday',
                '/doanh-thu/thang-nay' => 'revenue/month',
                '/doanh-thu/thang-truoc' => 'revenue/preMonth',
                '/doanh-thu/theo-thang' => 'revenue/monthYear',
                /* --End revenue-- */
                
                /* -- revenue-- */
                '/tai-khoan' => 'account/index',
                '/tai-khoan/doi-mat-khau' => 'account/changePassword',
                '/tai-khoan/cap-nhat' => 'account/edit',
                '/tai-khoan/cap-nhat-thanh-toan' => 'account/paymentEdit',
                '/tai-khoan/cap-nhat-thanh-toan-theo-the-cao' => 'account/paymentByCardEdit',
                /* --End revenue-- */
                
                '/ung-dung/<alias>-<appId:\d+>-<userId:\d+>-<extension>'=>'fileApp/index',
                '/ung-dung/<alias>-<appId:\d+>-<userId:\d+>'=>'fileApp/index',
                
                '/ung-dung/download-<appId:\d+>-<userId:\d+>-<extension>'=>'fileApp/download',
                '/ung-dung/download/<alias>-<appId:\d+>-<userId:\d+>'=>'fileApp/download',
                '/ung-dung/download-<appId:\d+>-<userId:\d+>'=>'fileApp/download',
                '/ung-dung/downloadFile-<fileId:\d+>-<userId:\d+>'=>'fileApp/downloadFile',
                
                '/game/<alias>-<gameId:\d+>-<userId:\d+>-<extension>'=>'fileGame/index',
                '/game/<alias>-<gameId:\d+>-<userId:\d+>'=>'fileGame/index',
                
                '/game/download-<gameId:\d+>-<userId:\d+>-<extension>'=>'fileGame/download',
                '/game/download/<alias>-<gameId:\d+>-<userId:\d+>'=>'fileGame/download',
                '/game/download-<gameId:\d+>-<userId:\d+>'=>'fileGame/download',
                '/game/downloadFile-<fileId:\d+>-<userId:\d+>'=>'fileGame/downloadFile',
                
                'admincp/<controller:\w+>/<action:\w+>'=>'admincp/<controller>/<action>',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
            ),
        ),
        'cache' => array (
            'class'=>'system.caching.CFileCache',
            /*
            'class' => 'CMemCache',
               'servers'=>array(
            array(
                   'host'=>'localhost',
                'port'=>11211,
                'weight'=>60,
                ),
            ),
            */
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
			),
		),
	),
	
	'params'=>require(dirname(__FILE__).'/con_params.php'),
);
